package main

import(
	"github.com/go-gl/glfw/v3.2/glfw"
)

var opcity float32= 0.2;

func key_callback(w *glfw.Window, key glfw.Key, scancode int, action glfw.Action, mods glfw.ModifierKey){
	if key == glfw.KeyEscape && action == glfw.Press{
		w.SetShouldClose(true)
	}
	if key == glfw.KeyUp && action == glfw.Press{
		opcity+= 0.1;
	}
	if key == glfw.KeyDown && action == glfw.Press{
		opcity-= 0.1;
	}
	ca.ProcessKeyboard(key,action)
}

var lastX,lastY float64
var firstMouse = true;
func mouse_callback(w *glfw.Window, xpos float64, ypos float64){
	if(firstMouse){
		lastX = xpos
		lastY = ypos
		firstMouse = false
	}

	xoffset := xpos - lastX
	yoffset := lastY - ypos
	lastX = xpos
	lastY = ypos
	ca.ProcessMouseMovement(float32(xoffset),float32(yoffset))
}

func scroll_callback(w *glfw.Window, xoff float64, yoff float64){
	ca.ProcessMouseScroll(yoff)
}